package com.atguigu.Spring5.pojo;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.lang.Nullable;

/**
 * @Author xiao hu die
 * @Date 2022/3/29 22:59
 * @Version 1.0
 */
public class MyBeanPost implements BeanPostProcessor {
    @Nullable
   public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println(beanName +"初始化之前实现的方法" +bean.toString());
        return bean;
    }

    @Nullable
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println(beanName +"初始化之后实现的方法" +bean.toString());
        return bean;
    }
}
